package Deque;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
@Auther: MFM
@Date: 2021/7/28 - 07 - 28 - 16:02 
@version: 1.0
*/

public class Demo {
    public static void main(String[] args) {
        Map<String,String> map  = new HashMap<>();
        map.put("abc","ABC");
        map.put("def","DEF");
        map.put("123","一二三");
        map.put("456","四五六");
        Set<Map.Entry<String, String>> set = map.entrySet();

        for (Map.Entry<String, String> entry : set) {
            System.out.println(entry.getKey());
            System.out.println(entry.getValue());
            if (entry.getKey().equals("abc")){
                entry.setValue("数值替换");
            }
        }
        System.out.println(map);

    }
}
